package com.rectcircle.wechat.msg.vo;

import java.util.LinkedList;
import java.util.List;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;

import com.rectcircle.wechat.util.CDATAAdapter;

/**
 * 
 * 微信消息的封装类包含各种消息的所有字段<br>
 * 为了方便转换所有字段的默认值为null
 * 
 * @author RectCircle
 * @version 0.1<br>
 * 2016年7月17日-下午9:58:09<br>
 * Copyright (c) 2016 RectCircle-版权所有<br>
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlRootElement(name="xml")
public class Message {
	@XmlJavaTypeAdapter(CDATAAdapter.class)
	@XmlElement(name="ToUserName")
	private String ToUserName = null;
	
	@XmlJavaTypeAdapter(CDATAAdapter.class)
	@XmlElement(name="FromUserName")
	private String FromUserName = null;
	
	@XmlElement(name="CreateTime")
	private String CreateTime = null;
	
	@XmlJavaTypeAdapter(CDATAAdapter.class)
	@XmlElement(name="MsgType")
	private String MsgType = null;
	
	@XmlElement(name="MsgId")
	private String MsgId = null;
	
	@XmlElement(name="MsgID")
	private String MsgID = null;
	
	@XmlJavaTypeAdapter(CDATAAdapter.class)
	@XmlElement(name="Event")
	private String Event = null;
	
	@XmlElement(name="TotalCount")
	private String TotalCount =null;
	
	@XmlElement(name="FilterCount")
	private String FilterCount =null;

	@XmlElement(name="SentCount")
	private String SentCount =null;

	@XmlElement(name="ErrorCount")
	private String ErrorCount =null;

	@XmlJavaTypeAdapter(CDATAAdapter.class)
	@XmlElement(name="Status")
	private String Status = null;

	@XmlJavaTypeAdapter(CDATAAdapter.class)
	@XmlElement(name="EventKey")
	private String EventKey = null;

	@XmlJavaTypeAdapter(CDATAAdapter.class)
	@XmlElement(name="Ticket")
	private String Ticket = null;

	@XmlElement(name="Latitude")
	private String Latitude = null;

	@XmlElement(name="Longitude")
	private String Longitude = null;

	@XmlElement(name="Precision")
	private String Precision = null;

	@XmlJavaTypeAdapter(CDATAAdapter.class)
	@XmlElement(name="PicUrl")
	private String PicUrl = null;
	
	@XmlJavaTypeAdapter(CDATAAdapter.class)
	@XmlElement(name="MediaId")
	private String MediaId = null;


	@XmlJavaTypeAdapter(CDATAAdapter.class)
	@XmlElement(name="Title")
	private String Title = null;

	@XmlJavaTypeAdapter(CDATAAdapter.class)
	@XmlElement(name="Description")
	private String Description = null;
	
	@XmlJavaTypeAdapter(CDATAAdapter.class)
	@XmlElement(name="Url")
	private String Url = null;
	
	@XmlElement(name="Location_X")
	private String Location_X = null;

	@XmlElement(name="Location_Y")
	private String Location_Y = null;

	@XmlElement(name="Scale")
	private String Scale = null;
	
	@XmlJavaTypeAdapter(CDATAAdapter.class)
	@XmlElement(name="Label")
	private String Label = null;

	@XmlJavaTypeAdapter(CDATAAdapter.class)
	@XmlElement(name="Content")
	private String Content = null;
	
	@XmlJavaTypeAdapter(CDATAAdapter.class)
	@XmlElement(name="Format")
	private String Format = null;
	
	@XmlJavaTypeAdapter(CDATAAdapter.class)
	@XmlElement(name="Recognition")
	private String Recognition = null;
	
	@XmlElement(name="MenuId")
	private String MenuId = null;
	
	@XmlJavaTypeAdapter(CDATAAdapter.class)
	@XmlElement(name="ThumbMediaId")
	private String ThumbMediaId = null;
	
	@XmlElement(name="ScanCodeInfo")
	private ScanCodeInfo scanCodeInfo = null;
	
	@XmlElement(name="SendPicsInfo")
	private SendPicsInfo sendPicsInfo = null;
	
	@XmlElement(name="SendLocationInfo")
	private SendLocationInfo sendLocationInfo = null;
	
	@XmlElementWrapper(name="Image")
	@XmlJavaTypeAdapter(CDATAAdapter.class)
	@XmlElement(name="MediaId")
	private LinkedList<String> Image = null;
	
	@XmlElementWrapper(name="Voice")
	@XmlJavaTypeAdapter(CDATAAdapter.class)
	@XmlElement(name="MediaId")
	private LinkedList<String> Voice = null;
	
	@XmlElement(name="Video")
	private Video video = null;
	
	@XmlElement(name="Music")
	private Music music = null;
	
	@XmlElement(name="ArticleCount")
	private String ArticleCount = null;
	
	@XmlElementWrapper(name="Articles")
	@XmlElement(name="item")
	private List<NewsItem> Articles = null;
	
	public String getArticleCount() {
		return ArticleCount;
	}
	
	public List<NewsItem> getArticles() {
		return Articles;
	}
	
	public String getContent() {
		return Content;
	}
	
	public String getCreateTime() {
		return CreateTime;
	}
	
	public String getDescription() {
		return Description;
	}
	
	public String getErrorCount() {
		return ErrorCount;
	}
	
	public String getEvent() {
		return Event;
	}

	public String getEventKey() {
		return EventKey;
	}
	
	public String getFilterCount() {
		return FilterCount;
	}
	
	public String getFormat() {
		return Format;
	}

	public String getFromUserName() {
		return FromUserName;
	}

	public String getImage() {
		if(Image==null){
			return null;
		} else {
			return Image.get(0);
		}
	}
	
	public String getLabel() {
		return Label;
	}

	public String getLatitude() {
		return Latitude;
	}

	public String getLocation_X() {
		return Location_X;
	}

	public String getLocation_Y() {
		return Location_Y;
	}
	
	public String getLongitude() {
		return Longitude;
	}

	public String getMediaId() {
		return MediaId;
	}

	public String getMenuId() {
		return MenuId;
	}
	
	public String getMsgId() {
		return MsgId;
	}
	

	public String getMsgID() {
		return MsgID;
	}

	public String getMsgType() {
		return MsgType;
	}
	
	public Music getMusic() {
		return music;
	}

	public String getPicUrl() {
		return PicUrl;
	}

	public String getPrecision() {
		return Precision;
	}
	
	

	public String getRecognition() {
		return Recognition;
	}
	
	public String getScale() {
		return Scale;
	}

	public ScanCodeInfo getScanCodeInfo() {
		return scanCodeInfo;
	}

	public SendLocationInfo getSendLocationInfo() {
		return sendLocationInfo;
	}

	public SendPicsInfo getSendPicsInfo() {
		return sendPicsInfo;
	}

	public String getSentCount() {
		return SentCount;
	}

	public String getStatus() {
		return Status;
	}

	public String getThumbMediaId() {
		return ThumbMediaId;
	}

	public String getTicket() {
		return Ticket;
	}

	public String getTitle() {
		return Title;
	}

	public String getTotalCount() {
		return TotalCount;
	}

	public String getToUserName() {
		return ToUserName;
	}

	public String getUrl() {
		return Url;
	}

	public Video getVideo() {
		return video;
	}

	public String getVoice() {
		if(Voice==null){
			return null;
		} else {
			return Voice.get(0);
		}
	}

	public void setArticleCount(String articleCount) {
		ArticleCount = articleCount;
	}

	public void setArticles(List<NewsItem> articles) {
		Articles = articles;
	}

	public void setContent(String content) {
		Content = content;
	}

	public void setCreateTime(String createTime) {
		CreateTime = createTime;
	}

	public void setDescription(String description) {
		Description = description;
	}

	public void setErrorCount(String errorCount) {
		ErrorCount = errorCount;
	}

	public void setEvent(String event) {
		Event = event;
	}

	public void setEventKey(String eventKey) {
		EventKey = eventKey;
	}

	public void setFilterCount(String filterCount) {
		FilterCount = filterCount;
	}

	public void setFormat(String format) {
		Format = format;
	}

	public void setFromUserName(String fromUserName) {
		FromUserName = fromUserName;
	}

	public void setImage(String imageId) {
		Image = new LinkedList<>();
		Image.add(imageId);
	}

	public void setLabel(String label) {
		Label = label;
	}

	public void setLatitude(String latitude) {
		Latitude = latitude;
	}

	public void setLocation_X(String locationX) {
		Location_X = locationX;
	}

	public void setLocation_Y(String locationY) {
		Location_Y = locationY;
	}

	public void setLongitude(String longitude) {
		Longitude = longitude;
	}

	public void setMediaId(String mediaId) {
		MediaId = mediaId;
	}

	public void setMenuId(String menuId) {
		MenuId = menuId;
	}

	public void setMsgId(String msgId) {
		MsgId = msgId;
	}

	public void setMsgID(String msgID) {
		MsgID = msgID;
	}

	public void setMsgType(String msgType) {
		MsgType = msgType;
	}

	public void setMusic(Music music) {
		this.music = music;
	}

	public void setPicUrl(String picUrl) {
		PicUrl = picUrl;
	}

	public void setPrecision(String precision) {
		Precision = precision;
	}

	public void setRecognition(String recognition) {
		Recognition = recognition;
	}

	public void setScale(String scale) {
		Scale = scale;
	}

	public void setScanCodeInfo(ScanCodeInfo scanCodeInfo) {
		this.scanCodeInfo = scanCodeInfo;
	}

	public void setSendLocationInfo(SendLocationInfo sendLocationInfo) {
		this.sendLocationInfo = sendLocationInfo;
	}

	public void setSendPicsInfo(SendPicsInfo sendPicsInfo) {
		this.sendPicsInfo = sendPicsInfo;
	}

	public void setSentCount(String sentCount) {
		SentCount = sentCount;
	}

	public void setStatus(String status) {
		Status = status;
	}

	public void setThumbMediaId(String thumbMediaId) {
		ThumbMediaId = thumbMediaId;
	}

	public void setTicket(String ticket) {
		Ticket = ticket;
	}

	public void setTitle(String title) {
		Title = title;
	}

	public void setTotalCount(String totalCount) {
		TotalCount = totalCount;
	}

	public void setToUserName(String toUserName) {
		ToUserName = toUserName;
	}

	public void setUrl(String url) {
		Url = url;
	}

	public void setVideo(Video video) {
		this.video = video;
	}

	public void setVoice(String voiceId) {
		Voice = new LinkedList<>();
		Voice.add(voiceId);
	}

	@Override
	public String toString() {
		return "Message [ToUserName=" + ToUserName + ", FromUserName=" + FromUserName + ", CreateTime=" + CreateTime
				+ ", MsgType=" + MsgType + ", MsgId=" + MsgId + ", MsgID=" + MsgID + ", Event=" + Event
				+ ", TotalCount=" + TotalCount + ", FilterCount=" + FilterCount + ", SentCount=" + SentCount
				+ ", ErrorCount=" + ErrorCount + ", Status=" + Status + ", EventKey=" + EventKey + ", Ticket=" + Ticket
				+ ", Latitude=" + Latitude + ", Longitude=" + Longitude + ", Precision=" + Precision + ", PicUrl="
				+ PicUrl + ", MediaId=" + MediaId + ", Title=" + Title + ", Description=" + Description + ", Url=" + Url
				+ ", Location_X=" + Location_X + ", Location_Y=" + Location_Y + ", Scale=" + Scale + ", Label=" + Label
				+ ", Content=" + Content + ", Format=" + Format + ", Recognition=" + Recognition + ", MenuId=" + MenuId
				+ ", ThumbMediaId=" + ThumbMediaId + ", scanCodeInfo=" + scanCodeInfo + ", sendPicsInfo=" + sendPicsInfo
				+ ", sendLocationInfo=" + sendLocationInfo + ", Image=" + Image + ", Voice=" + Voice + ", video="
				+ video + ", music=" + music + ", ArticleCount=" + ArticleCount + ", Articles=" + Articles + "]";
	}


	
}
